'''
Created on Oct 24, 2011

@author: Enrique R <erosales.aci@gmail.com>
'''
import unittest
from Reader import Reader

class TestReader(unittest.TestCase):

    def setUp(self):
        self.reader = Reader()

    def testCanReadCSV(self):
        self.reader.readCSV('test.csv',50)
        self.assertIsInstance(self.reader, Reader, "Error reading 50 lines in CSV")
        self.reader.readCSV('test.csv',500)
        self.assertIsInstance(self.reader, Reader, "Error reading 500 lines in CSV")
        self.reader.readCSV('test.csv',5000)
        self.assertIsInstance(self.reader, Reader, "Error reading 5000 lines in CSV")
    
    def testCanReadXML(self):
        self.reader.readXML('test.xml', 50)
        self.assertIsInstance(self.reader, Reader, "Error reading 50 XML")
        self.reader.readXML('test.xml', 500)
        self.assertIsInstance(self.reader, Reader, "Error reading 500 XML")
        self.reader.readXML('test.xml', 5000)
        self.assertIsInstance(self.reader, Reader, "Error reading 5000 XML")
        
    def tearDown(self):
        pass

if __name__ == "__main__":
    #import sys;sys.argv = ['', 'Test.testName']
    unittest.main()